package server;
/**
 * This class represents the Farmer class
 * which indicates the name, email, location, and so on.
 * It is pretty much self-explanatory
 * @author Team 15 
 */
import java.io.Serializable;

public class Farmer implements Serializable{
        private int passhash;
        private String name;
        private String email;
        private int pubLocation;
        private String privLocation;
        private String aboutMe;
        private boolean isAdmin;
        private boolean lockout;
        
        
        /**
         * Constructor that establish a new farmer/ user
         * @param name
         * @param email
         * @param passhash
         * @param pubLocation
         * @param privLocation
         * @param aboutMe
         */
        public Farmer(String name, String email, int passhash, int pubLocation,
                        String privLocation, String aboutMe)
        {
                this.name = name;
                this.email = email;
                this.passhash = passhash;
                this.pubLocation = pubLocation;
                this.privLocation = privLocation;
                this.aboutMe = aboutMe;
                this.isAdmin = false;
                this.lockout= false;
        }
        
        /**
         * If people dont type certain things, we will generate for them
         * which we leave here as defaults
         * @param name
         * @param email
         * @param passhash
         * @param pubLocation
         */
        public Farmer(String name, String email, int passhash, int pubLocation)
        {
        		this.name = name;
        		this.email = email;
        		this.passhash = passhash;
        		this.pubLocation = pubLocation;
        		this.privLocation = "Not given";
        		this.aboutMe = "Not given";
                        this.isAdmin=false;
                        this.lockout=false;
        }
        
        /**
         * Get password's hashcode
         * @return
         */
        public int getPasshash() {
                return passhash;
        }
        
        /**
         * set password's hashcode
         * @param passhash
         */
        public void setPasshash(int passhash) {
                this.passhash = passhash;
        }


        /*
         * The following methods are setters and getters
         * They're pretty much self-explanatory 
         */
        
        /**
         * Get name
         * @return
         */
        public String getName() {
                return name;
        }
        
        /**
         * set Name
         * @param name
         */
        public void setName(String name) {
                this.name = name;
        }
        
        /**
         * Get the email name 
         * @return
         */
        public String getEmail() {
                return email;
        }
        
        /**
         * Set the email address 
         * @param email
         */
        public void setEmail(String email) {
                this.email = email;
        }
        
        /**
         * Get the public location 
         * @return
         */
        public int getPubLocation() {
                return pubLocation;
        }
        /**
         * Set tehe public location
         * @param pubLocation
         */
        public void setPubLocation(int pubLocation) {
                this.pubLocation = pubLocation;
        }
        
        /**
         * get the private location
         * @return
         */
        public String getPrivLocation() {
                return privLocation;
        }
        
        /**
         * set the private location 
         * @param privLocation
         */
        public void setPrivLocation(String privLocation) {
                this.privLocation = privLocation;
        }
        /**
         * get the about me infomation
         * @return
         */
        public String getAboutMe() {
                return aboutMe;
        }
       /**
        * set the about me infomation
        */
        public void setAboutMe(String aboutMe) {
                this.aboutMe = aboutMe;
        }
        
        /**
         * Check if the user is admin or not
         * @return
         */
        public Boolean getIsAdmin() {
                return isAdmin;
        }
        
        /**
         * Change the user status to either admin or regular 
         * @param isAdmin
         */
        public void setIsAdmin(Boolean isAdmin) {
                this.isAdmin = isAdmin;
        }
        /**
         * check the user lockout status  
         * @return
         */
        public Boolean getLockout(){
            return lockout;
        }
        /**
         * Clear out user lockout
         * @param lockout
         */
        public void setLockout(Boolean lockout){
            this.lockout=lockout;
        }

}
